package com.telit.firecommand.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.telit.firecommand.entity.FirePop;
import com.telit.firecommand.vo.FireAlarmsPushVO;
import com.telit.firecommand.vo.FirePopVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface FirePopDao extends BaseMapper<FirePop> {
    int deleteByPrimaryKey(Long id);

    int insert(FirePop record);

    int insertSelective(FirePop record);

    FirePop selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(FirePop record);

    int updateByPrimaryKey(FirePop record);

    List<FirePopVO>selectPopByDistrictCode(String districtCode );

    void downPop(String fireId);

    List<FireAlarmsPushVO>selectfireByFireids(@Param("districtCode") String districtCode);

    @Select("SELECT   b.config_name AS NAME  FROM fire_config_name_code A INNER JOIN fire_config_name_code b ON A.ID = b.parent_id  WHERE A.config_code = 'alarms_source_type' AND b.config_code = #{sourceType} ")
    String findDictNameByCode(@Param("sourceType") String sourceType);
}